/* Copyright (c) 2012 Nordic Semiconductor. All Rights Reserved.
 *
 * The information contained herein is property of Nordic Semiconductor ASA.
 * Terms and conditions of usage are described in detail in NORDIC
 * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
 *
 * Licensees are granted free, non-transferable use of the information. NO
 * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
 * the file.
 *
 * $LastChangedRevision$
 */

 /** @cond To make doxygen skip this file */
 
/** @file
 *
 * @defgroup ble_sdk_app_hids_mouse_events Scheduler events
 * @{
 * @ingroup ble_sdk_app_hids_mouse
 * @brief Definitions of events to be used by the applications.
 *
 * @details This file contains application specific definitions.
 */

#ifndef APP_SCHEDULER_CFG_H__
#define APP_SCHEDULER_CFG_H__

#include "ble.h"
#include "app_timer.h"

#define APP_SCHED_QUEUE_NUM       2                             /**< Number of scheduler queues (i.e. number of priorities). */
#define APP_SCHED_QUEUE_SIZE      10                            /**< Size of scheduler queues. */

#define APP_SCHED_QUEUE_HIGH_PRI  0                             /**< High priority scheduler queue. */
#define APP_SCHED_QUEUE_LOW_PRI   1                             /**< Low priority scheduler queue. */

/**@brief Set of defined events. */
typedef enum 
{
    APP_SCHED_EVENT_BLE,                                        /**< Bluetooth stack event. This must be defined for all applications using the Bluetooth stack. */
    APP_SCHED_EVENT_TIMER,                                      /**< Timer event. This must be defined if app_timer is to be used. */
    APP_SCHED_EVENT_MOUSE                                       /**< Mouse event. */
} app_sched_event_id_t;

/**@brief Scheduler event data type. */
typedef struct 
{
    app_sched_event_id_t event_id;                              /**< Event id. */
    union 
    {
        struct
        {
            ble_evt_t ble_evt;                                  /**< Bluetooth stack event data. */
        } ble;
        struct
        {
            app_timer_id_t              timer_id;               /**< Timer id. */
            app_timer_timeout_handler_t timeout_handler;        /**< Handler to be called when timer expires. */
        } timer;
        struct
        {
            int16_t x_delta;                                    /**< Horizontal movement. */
            int16_t y_delta;                                    /**< Vertical movement. */
        } mouse;
    } data;
} app_sched_event_data_t;

#endif // APP_SCHEDULER_CFG_H__

/** @} */
/** @endcond */
